#ifndef __FTPLOG_H_
#define __FTPLOG_H_




#include "stdio.h"
#include <stdarg.h>
#include <stdlib.h>
 

#define FATAL      1
#define ALARM      2
#define ERROR      3
#define WARN       4
#define INFO       5
#define DEBUG      6

#define DEBUGLEVEL  WARN

#define PRESENT_BIT32(x)        (((uint32)((uint32)1<<(x)))) //对应位的值
#define BIT_ON32(m, b)            (((m) & PRESENT_BIT32(b)) != 0)
#define SET_BIT32(m, b)            ((m) |= PRESENT_BIT32(b))
#define CLEAR_BIT32(m, b)        ((m) &= ~PRESENT_BIT32(b))

#define MY_LOG(level, fmt, ...)  do{  \
    if(level <= DEBUGLEVEL){  \
        printf("[%s][%s][%d]:",__FILE__, __FUNCTION__, __LINE__); \
        printf(fmt,  ##__VA_ARGS__); \
    }  \
}while(0)

#define MY_ERROR_LOG(fmt, ...)   MY_LOG(ERROR, fmt, ##__VA_ARGS__)




#endif
